<?php
	$isLocal = $_SERVER['SERVER_NAME'] === "localhost";

	if ($isLocal) {
		$host = "local_host";
		$user = "local_user";
		$pass = "local_password";
		$db_name = "font_awesome_5";
	} else {
		$host = "remote_host";
		$user = "remote_user";
		$pass = "remote_password";
		$db_name = "font_awesome_5";
	}

	$conn = @mysql_connect($host, $user, $pass);

	if (!$conn) {die("连接数据库失败：" . mysql_error());}

	mysql_select_db($db_name, $conn);

	// 设置默认时区
	date_default_timezone_set("Asia/Shanghai");

	// 字符转换，读库
	mysql_query("set character set utf8");

	// 写库
	mysql_query("set names utf8");
?>